package router

import (
	"net/http"
	"perm-guard/hdeloisg"

	"github.com/gin-gonic/gin"
)

func Init() *gin.Engine {
	// 1.创建路由
	r := gin.Default()

	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})

	r.POST("/login", hdeloisg.UserLogin)

	r.POST("/user/add", hdeloisg.UserAdd)

	r.POST("/roleNodeAdd", hdeloisg.RoleNodeAdd)

	r.GET("/UserRoleList", hdeloisg.UserRoleList)

	r.GET("/UserRoleLists", hdeloisg.UserRoleLists)

	r.GET("/OrderList", hdeloisg.OrderList)

	r.GET("/OrderXq", hdeloisg.OrderXq)
	return r
}
